package app.common.dao;
import java.util.ArrayList;
import java.util.List;

import cn.lily.com.container.data.Record;
import cn.lily.com.exception.YaconException;
import cn.lily.esb.framework.drivers.db.bean.ControlDAO;
public class Leo_tagBean extends ControlDAO implements Cloneable {
	private static final long serialVersionUID = 1L;
	public Leo_tagBean() throws YaconException {
		super();
		setTableName("LEO_TAG");
	}
	String  ftag_nam;
	String  ftag_id;
	String  fcreate_oper;
	String  fcreate_time;

	public void setTag_nam( String tag_nam)throws YaconException{
		setFieldData("tag_nam",tag_nam,TEXT);
		this.ftag_nam=tag_nam;
	}

	public String getTag_nam(){
		if ( this.ftag_nam == null){
			return "";
		}
		else {
			return this.ftag_nam;
		}
	}

	public void setTag_id( String tag_id)throws YaconException{
		setFieldData("tag_id",tag_id,TEXT);
		this.ftag_id=tag_id;
	}

	public String getTag_id(){
		if ( this.ftag_id == null){
			return "";
		}
		else {
			return this.ftag_id;
		}
	}

	public void setCreate_oper( String create_oper)throws YaconException{
		setFieldData("create_oper",create_oper,TEXT);
		this.fcreate_oper=create_oper;
	}

	public String getCreate_oper(){
		if ( this.fcreate_oper == null){
			return "";
		}
		else {
			return this.fcreate_oper;
		}
	}

	public void setCreate_time( String create_time)throws YaconException{
		setFieldData("create_time",create_time,DATE);
		this.fcreate_time=create_time;
	}

	public String getCreate_time(){
		if ( this.fcreate_time == null){
			return "";
		}
		else {
			return this.fcreate_time;
		}
	}

	public  List<Leo_tagBean> findListBeans(String sSqlWhere)throws YaconException {
		List<Leo_tagBean> listBeans = new ArrayList<Leo_tagBean>();
		findTable = findTableByWhere(sSqlWhere);
		while (findTable.next())
		{
			Leo_tagBean fDaoBean  = new Leo_tagBean();
			fDaoBean.ftag_nam = findTable.getString("tag_nam");
			fDaoBean.ftag_id = findTable.getString("tag_id");
			fDaoBean.fcreate_oper = findTable.getString("create_oper");
			fDaoBean.fcreate_time = findTable.getString("create_time");
			fDaoBean.operate_mode = "edit";
			listBeans.add(fDaoBean);
		}
		return listBeans;
	}

	public Leo_tagBean findBean(String sSqlWhere)throws YaconException {
		findTable = findTableByWhere(sSqlWhere);
		if (findTable.next())
		{
			Leo_tagBean fDaoBean  = new Leo_tagBean();
			fDaoBean.ftag_nam = findTable.getString("tag_nam");
			fDaoBean.ftag_id = findTable.getString("tag_id");
			fDaoBean.fcreate_oper = findTable.getString("create_oper");
			fDaoBean.fcreate_time = findTable.getString("create_time");
			fDaoBean.operate_mode = "edit";
			return fDaoBean;
		}else
			return null;
	}

	public void setViewRecord(Record viewRecord) throws YaconException{
		if (viewRecord.getString("tag_nam") != null)
			setTag_nam(viewRecord.getString("tag_nam"));
		if (viewRecord.getString("tag_id") != null)
			setTag_id(viewRecord.getString("tag_id"));
		if (viewRecord.getString("create_oper") != null)
			setCreate_oper(viewRecord.getString("create_oper"));
		if (viewRecord.getString("create_time") != null)
			setCreate_time(viewRecord.getString("create_time"));
	}

}
